package com.tang.service.impl;

import com.tang.dao.BookMapper;
import com.tang.pojo.Books;
import com.tang.service.BookService;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author Tom
 * @ClassName BookServiceImpl
 * @Date 2021/10/23 22:31
 */
@Data
@Service
public class BookServiceImpl implements BookService {
 //service调用dao层
 @Autowired
 private BookMapper bookMapper;
 public int addBook(Books books) {
  return bookMapper.addBook(books);
 }

 public int deleteBookById(int id) {
  return bookMapper.deleteBookById(id);
 }

 public int updateBook(Books books) {
  return bookMapper.updateBook(books);
 }

 public Books queryBookBookById(int id) {
  return bookMapper.queryBookBookById(id);
 }

 public List<Books> queryAllBook() {
  return bookMapper.queryAllBook();
 }

 public List<Books> queryBookByName(String bookName) {
  return bookMapper.queryBookByName(bookName);
 }
}
    